package com.dating.view;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dating.activity.R;

public class RowCompareYouHer extends LinearLayout{
	TextView tvMe,tvHer,typeMatching;
	ImageView ivMatching;
	
	LayoutInflater inflater=null;
	public RowCompareYouHer(Context context) {
		super(context);
		inflate(context);
		
		findViewById();
		
		
	}
	public RowCompareYouHer(Context context,String me,String her,String tMatching) {
		super(context);
		inflate(context);
		
		findViewById();
		
		addMatching(me, her,tMatching);
	}
	public RowCompareYouHer(Context context,String me,String her,String tMatching,Bitmap image) {
		super(context);
		inflate(context);
		
		findViewById();
		
		addMatching(me, her,tMatching, image);
	}
	public RowCompareYouHer(Context context,String me,String her,String tMatching,int idImage) {
		super(context);
		inflate(context);
		
		findViewById();
		
		addMatching(me, her,tMatching, idImage);
	}
	private void inflate(Context context){
		inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.row_compare_you_her, this);
	}
	private void findViewById(){
		tvMe=(TextView)findViewById(R.id.tv_me);
		tvHer=(TextView)findViewById(R.id.tv_her);
		typeMatching=(TextView)findViewById(R.id.typeMatching);
		ivMatching=(ImageView)findViewById(R.id.iv_matching);
	}
	public void addMatching(String me,String her,String tMatching,Bitmap image){
		tvMe.setText(me);
		tvHer.setText(her);
		typeMatching.setText(tMatching);
		ivMatching.setImageBitmap(image);
	}
	public void addMatching(String me,String her,String tMatching,int idImage){
		tvMe.setText(me);
		tvHer.setText(her);
		typeMatching.setText(tMatching);
		ivMatching.setImageResource(idImage);
	}
	public void addMatching(String me,String her,String tMatching){
		tvMe.setText(me);
		tvHer.setText(her);
		typeMatching.setText(tMatching);
		ivMatching.setImageResource(R.drawable.nhaycam);
	}
}
